<?php

namespace App\Http\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Http\Models\Airport
 *
 * @property int $id IATA机场三字码
 * @property string|null $name 机场名称
 * @property string|null $city_id 城市ID
 * @method static \Illuminate\Database\Eloquent\Builder|Airport newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Airport newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Airport query()
 * @method static \Illuminate\Database\Eloquent\Builder|Airport whereCityId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Airport whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Airport whereName($value)
 * @mixin \Eloquent
 */
class Airport extends Model
{
	public $incrementing = false;
	protected $keyType = 'string';
	public $timestamps = false;
	protected $fillable = ['id', 'name', 'city_id'];

	//正向，一对多关联 Terminal 表
	public function terminals() {
		return $this->hasMany(Terminal::class, 'airport_id', 'id');
	}
}
